package calbs.socket.packaging;/**
 * Created by zhangqin on 2017/8/7.
 */


import calbs.socket.enu.FrameReqEnum;
import calbs.socket.enu.FrameRespEnum;
import calbs.socket.pojo.resp.RespData;
import calbs.socket.service.ServerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 封装数据
 *
 * @author
 * @create 2017-08-07 14:08
 **/

public final class PackagingFactory {
    Logger logger = LoggerFactory.getLogger(PackagingFactory.class);


    public static PackagingI bulidPackaging(String frameNumber){
        FrameRespEnum frameReqEnum = FrameRespEnum.getFrameEnum(frameNumber);
        switch (frameReqEnum){
            case SD_REFUSE:
                return new LoginRefusePackingImp();
            case SD_ACCEPT:
                return new LoginAcceptPackagingImp();
            case SD_GETLINE://获取AB线
                return new AblineRespPackagingImp();
            case SD_UPLOADLINE://上传AB线
                return new UploadLinePackingImp();
            case SD_UPDATE://软件升级
                return new SoftUpdateVersionPackingImp();
            case SD_FINISH://上传位置数据
                return new FinishPackagingImp();
            case CMD_NOP://上传位置数据
                return new NopPackingImp();
        }
        return new FinishPackagingImp();
    }
}
